import instance from '@/utils/axios'

import product from "./producttree.json"
import publishlist from "./publishlist.json"
import savelist from "./savelist.json"
/**
 * 获取工程标题
 */
export function getSystemTitle() {
  //  return new Promise((resolve,reject)=>{
  //   resolve(product);
  //  })
  return instance({
    url: '/cpzzapi/czCpzz/cpzz/querySystemTitle',
    method: 'get',
  })
}


/**
 * 
 * @returns 获取左侧菜单
 */
export function getTaskTree() {
  //  return new Promise((resolve,reject)=>{
  //   resolve(product);
  //  })
  return instance({
    url: '/cpzzapi/czCpzz/cpzz/queryTaskTree',
    method: 'get',
  })
}

/**
 * 
 * @returns 发布列表
 */
export function getPubPDFListByTaskId(taskId) {
  // return new Promise((resolve,reject)=>{
  //  resolve(publishlist);
  // })
 return instance({
   url: '/cpzzapi/czCpzz/cpzz/queryPubPDFListByTaskId',
   method: 'get',
   params:{
    taskId:taskId
   }
 })
}

/**
 * 
 * @returns 保存列表
 */
export function getSavePDFListByTaskId(taskId) {
  // return new Promise((resolve,reject)=>{
  //  resolve(savelist);
  // })
 return instance({
   url: '/cpzzapi/czCpzz/cpzz/querySavePDFListByTaskId',
   method: 'get',
   params:{
    taskId:taskId
   }
 })
}
/**
 * 
 * @returns 查询模板id
 */
export function getModelInfoByTaskId(taskId) {
 return instance({
   url: '/cpzzapi/czCpzz/cpzz/queryModelInfoByTaskId',
   method: 'get',
   params:{
    taskId:taskId
   }
 })
}

/**
 * 
 * @param {继续编辑} param 
 * @returns 
 */
export function getContinueEdit(param) {
  return instance({
    url: '/cpzzapi/czCpzz/cpzz/continueEdit',
    method: 'get',
    params:param
  })
 }

/**
 * 初始化产品
 */
export function getinitProInfo(param) {
  return instance({
    url: '/cpzzapi/czCpzz/cpzz/initProInfo',
    method: 'get',
    params:param
  })
 }

 /**
  * 发布
  */
 export function getpublishPro(param) {
  return instance({
    url: '/cpzzapi/czCpzz/cpzz/publishPro',
    method: 'get',
    params:param
  })
 }

/**
 * 获取站点列表
 */
export function getStationList() {
  return instance({
    url: '/cpzzapi/czCpzz/cpzz/queryStationList',
    method: 'get'
  })
 }

 /**
  * 查询标签
  */
 export function getLabelByTaskId() {
  return instance({
    url: '/cpzzapi/czCpzz/label/findLabelByTaskId',
    method: 'get'
  })
 }
 /**
  * 查询标签结果
  */
 export function getCommLabel(data) {
  return instance({
    url: '/cpzzapi/czCpzz/label/execCommLabel',
    method: "post",
    data,
    headers: {
    'Content-Type': 'application/json'
    }
  })
 }
 
 /**
  * 查询表格数据-实况标签
  */
 export function getRealList(param) {
  return instance({
    url: '/cpzzapi/czCpzz/label/getRealList',
    method: "get",
    params:param
  })
 }

  /**
  * 查询表格数据-预报小时表格
  */
  export function getYbListByParam(param) {
    return instance({
      url: '/cpzzapi/czCpzz/label/getYbListByParam',
      method: "get",
      params:param
    })
  }

   /**
  * 查询表格数据-预报天表格
  */
   export function getNDaysForeList(param) {
    return instance({
      url: '/cpzzapi/czCpzz/label/getNDaysForeList',
      method: "get",
      params:param
    })
  }